#! /usr/bin/python

from zipfile import ZipFile

f = open('foo.zip', 'w')
z = ZipFile(file = f, mode = 'w')
z.writestr("foo", "foo test file")
z.writestr("b/bar", "bar test file")
z.writestr("b/baz", "baz test file")
z.writestr("b/f/fee", "fee test file")
z.writestr("b/f/fi", "fi test file")
print "getinfo is %s"%z.getinfo("b/baz")
print "infolist is %s"%z.infolist()
print "namelist is %s"%z.namelist()
# Appears to be buggy.
#print "printdir is %s"%z.printdir() 
z.close()
#f = open('foo.zip', 'r')
#z = ZipFile(file = f, mode = 'r')
#print z.read("foo")
#print z.read("b/f/fi")
#z.close()
